/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CastleDefense.Managers;

import CastleDefense.units.PlacedUnit;
import java.util.Comparator;

/**
 *
 * @author Firedemon
 */
public class PlacedUnitComparator implements Comparator<PlacedUnit>
{
    @Override
    public int compare(PlacedUnit unit1, PlacedUnit unit2) {

        double rank1 = unit1.tempDist;
        double rank2 = unit2.tempDist;

        if (rank1 > rank2){
            return +1;
        }else if (rank1 < rank2){
            return -1;
        }else{
            return 0;
        }
    }
}
